package main.day1_10;


import java.util.Comparator;

/**
 * @author mng
 *
**/
public class Person implements Comparator<Person> {
    private String name;
    private Integer age;

    public Person() {
    }

    public Person(String name, Integer age) {
        this.name = name;
        this.age = age;
    }
    @Override
    public  int compare(Person p1, Person p2){
        return p1.age.compareTo(p2.age);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }
}
